<div class="refentry" lang="en" xml:lang="en"><a id="glXCreatePbuffer"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glXCreatePbuffer — create an off-screen rendering area</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table><tr><td><code class="funcdef">GLXPbuffer <b class="fsfunc">glXCreatePbuffer</b>(</code></td><td>Display *  </td><td><var class="pdparam">dpy</var>, </td></tr><tr><td> </td><td>GLXFBConfig  </td><td><var class="pdparam">config</var>, </td></tr><tr><td> </td><td>const int *  </td><td><var class="pdparam">attrib_list</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>dpy</code></em></span></dt><dd><p>
                    Specifies the connection to the X server.
                </p></dd><dt><span class="term"><em class="parameter"><code>config</code></em></span></dt><dd><p>
                    Specifies a GLXFBConfig structure with the desired attributes for the
                    window.
                </p></dd><dt><span class="term"><em class="parameter"><code>attrib_list</code></em></span></dt><dd><p>
                    Specifies a list of attribute value pairs, which must be terminated with
                    <code class="constant">None</code> or <code class="constant">NULL</code>. Accepted attributes are
                    <code class="constant">GLX_PBUFFER_WIDTH</code>, <code class="constant">GLX_PBUFFER_HEIGHT</code>,
                    <code class="constant">GLX_PRESERVED_CONTENTS</code>, and <code class="constant">GLX_LARGEST_PBUFFER</code>.
                </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
            <code class="function">glXCreatePbuffer</code> creates an off-screen rendering area and returns its XID.
            Any GLX rendering context that was created with respect to <em class="parameter"><code>config</code></em>
            can be used to render into this window.
            Use <a class="citerefentry" href="glXMakeContextCurrent"><span class="citerefentry"><span class="refentrytitle">glXMakeContextCurrent</span></span></a> to associate the rendering area with a GLX
            rendering context.
        </p><p>
            The accepted attributes for a GLXPbuffer are:
        </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GLX_PBUFFER_WIDTH</code></span></dt><dd><p>
                        Specify the pixel width of the requested GLXPbuffer. The default value
                        is 0.
                    </p></dd><dt><span class="term"><code class="constant">GLX_PBUFFER_HEIGHT</code></span></dt><dd><p>
                        Specify the pixel height of the requested GLXPbuffer. The default value
                        is 0.
                    </p></dd><dt><span class="term"><code class="constant">GLX_LARGEST_PBUFFER</code></span></dt><dd><p>
                        Specify to obtain the largest available pixel buffer, if the requested
                        allocation would have failed. The width and height of the allocated
                        pixel buffer will never exceed the specified <code class="constant">GLX_PBUFFER_WIDTH</code> or
                        <code class="constant">GLX_PBUFFER_HEIGHT</code>, respectively.  Use <a class="citerefentry" href="glXQueryDrawable"><span class="citerefentry"><span class="refentrytitle">glXQueryDrawable</span></span></a> to
                        retrieve the dimensions of the allocated pixel buffer. The default value is
                        <code class="constant">False</code>.
                    </p></dd><dt><span class="term"><code class="constant">GLX_PRESERVED_CONTENTS</code></span></dt><dd><p>
                        Specify if the contents of the pixel buffer should be preserved when a
                        resource conflict occurs.  If set to <code class="constant">False</code>, the contents of the
                        pixel buffer may be lost at any time.  If set to <code class="constant">True</code>, or not
                        specified in <em class="parameter"><code>attrib_list</code></em>, then the contents of the pixel buffer will be preserved
                        (most likely by copying the contents into main system memory from the
                        frame buffer).  In either case, the client can register (using
                        <a class="citerefentry" href="glXSelectEvent"><span class="citerefentry"><span class="refentrytitle">glXSelectEvent</span></span></a>, to receive
                        pixel buffer clobber events that are generated when the pbuffer contents have
                        been preserved or damaged.
                    </p></dd></dl></div><p>
            GLXPbuffers contain the color and ancillary buffers specified by
            <em class="parameter"><code>config</code></em>.  It is possible to create a pixel buffer with back buffers and
            to swap those buffers using <a class="citerefentry" href="glXSwapBuffers"><span class="citerefentry"><span class="refentrytitle">glXSwapBuffers</span></span></a>.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p>
            <code class="function">glXCreatePbuffer</code> is available only if the GLX version is 1.3 or greater.
        </p><p>
            If the GLX version is 1.1 or 1.0, the GL version must be 1.0.
            If the GLX version is 1.2, then the GL version must be 1.1.
            If the GLX version is 1.3, then the GL version must be 1.2.
        </p><p>
            GLXPbuffers are allocated from frame buffer resources; applications
            should consider deallocating them when they are not in use.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
            <code class="constant">BadAlloc</code> is generated if there are insufficient resources to
            allocate the requested GLXPbuffer.
        </p><p>
            <code class="constant">GLXBadFBConfig</code> is generated if <em class="parameter"><code>config</code></em> is not a valid
            GLXFBConfig.
        </p><p>
            <code class="constant">BadMatch</code> is generated if <em class="parameter"><code>config</code></em> does not support rendering to
            pixel buffers (e.g., <code class="constant">GLX_DRAWABLE_TYPE</code> does not contain
            <code class="constant">GLX_PBUFFER_BIT</code>).
        </p></div>
        {$pipelinestall}{$examples}
        <div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
            <a class="citerefentry" href="glXChooseFBConfig"><span class="citerefentry"><span class="refentrytitle">glXChooseFBConfig</span></span></a>,
            <code class="function">glXCreatePbuffer</code>,
            <a class="citerefentry" href="glXMakeContextCurrent"><span class="citerefentry"><span class="refentrytitle">glXMakeContextCurrent</span></span></a>,
            <a class="citerefentry" href="glXSelectEvent"><span class="citerefentry"><span class="refentrytitle">glXSelectEvent</span></span></a>
        </p></div><div class="refsect1" lang="en" xml:lang="en"><div id="Copyright"><h2>Copyright</h2><p>
            Copyright © 1991-2006
            Silicon Graphics, Inc. This document is licensed under the SGI
            Free Software B License. For details, see
            <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
        </p></div></div></div>
